package cate.game.play.skill.active;

import cate.game.play.buff.BuffParam;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.SkillActionCtx;

/**
 * 蚩尤发怒时，会对敌方全体造成1080%总伤害，根据人数分摊，并根据伤害量为自身附加伤害量20%的护盾第2回合释放，
 */
public class 魔火焚世AH extends 均摊伤害AH {

	private int 护盾buff;
	private double 护盾系数;

	@Override
	public void parse(String code) {
		super.parse(code);
		PlayCfgArgs args = new PlayCfgArgs(code);
		护盾buff = args.getInt("护盾buff", 0);
		护盾系数 = args.getWDouble("护盾系数", 0d);
	}

	@Override
	public void onSkillDone(SkillActionCtx action) {
		double shield = action.getStat().getTotalDamage(skill.owner.getPid()) * 护盾系数;
		skill.owner.buff.tryAddByTid(action, skill.owner, 护盾buff, new BuffParam().buffHpSet(shield));
	}
}
